angular.module('driver')
	.factory('GPS', ['$localstorage', function($localstorage) {
		var o = {
			status: false,//gps开关状态
			path : [],//路径
			watchId: 0,//
		};

		var options = { maximumAge: 10000, timeout: 5000 };

		o.getGpsStatus = function () {

		};
		o.setGpsStatus = function () {

		};

		o.watchPosition = function (onSuccess, onError) {
			o.watchId = GPSLocation.watchPosition(onSuccess, onError, options);
		};
		o.stopWatch = function() {
			GPSLocation.clearWatch(o.watchID);
		};

		return o;
	}]);
